#include <iostream>
#include <cstring> // for std::memcpy

void* my_memcpy(void* dest, const void* src, size_t n) {
    char* d = static_cast<char*>(dest);
    const char* s = static_cast<const char*>(src);

    for (size_t i = 0; i < n; ++i) {
        d[i] = s[i];
    }

    return dest;
}

int main() {
    char src[] = "Hello, memcpy!";
    char dest[sizeof(src)];

    my_memcpy(dest, src, sizeof(src));

    std::cout << "Source: " << src << std::endl;
    std::cout << "Destination: " << dest << std::endl;

    return 0;
}